#ifndef _ACCEPTOR_H
#define _ACCEPTOR_H

namespace NetIO
{

class DllExport Acceptor
{
public:

	Acceptor( short port, const string &ip = "",
	          Reactor *reactor = Singleton<Reactor>::instance( ) );

	Acceptor( Reactor *reactor = Singleton<Reactor>::instance( ) );
public:

	~Acceptor( void );

	int open( short port = 0, const string &ip = "" );

	void close( );

	int async_accept( void *act = 0 );

	bool is_open( );

private:
	string ip_;

	short port_;

	Socket handle_;

	Reactor *reactor_;
};

};
#endif

